home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / dev / gui / DesignerV1_53.lha / Designer / PubScreenDemo / PubScreenDemoP1.s < prev    next >
Text File  |  1995-04-28  |  3KB  |  122 lines

  1. ; Compile me to get full executable
  2.  
  3.     include    pubscreendemop1win.i
  4.  
  5. GT_ReplyIMsg             EQU    -78
  6. GT_GetIMsg               EQU    -72
  7. WaitPort                 EQU    -384
  8. ItemAddress              EQU    -144
  9. GT_BeginRefresh          EQU    -90
  10. GT_EndRefresh            EQU    -96
  11. CloseScreen              EQU    -66
  12. PubScreenStatus          EQU    -552
  13.  
  14. Scr:
  15.     dc.l    0
  16. Gad:
  17.     dc.l    0
  18.  
  19. start
  20.  
  21.     jsr     OpenLibs
  22.     tst.l   d0
  23.     bne     NoLibs
  24.     jsr     OpenMyPubScrScreen
  25.     tst.l   d0
  26.     beq     NoScreen
  27.     move.l  d0,Scr
  28.     movea.l Scr,a0
  29.     move.l  #0,d0
  30.     movea.l _IntuitionBase,a6
  31.     jsr     PubScreenStatus(a6)
  32.     movea.l Scr,a1
  33.     jsr     OpenScrWinWindow
  34.     tst.l   d0
  35.     bne     NoWindow
  36. WaitHere:
  37.     move.l  ScrWin,a1
  38.     move.l  86(a1),a2
  39.     move.l  a2,a0
  40.     move.l  _SysBase,a6
  41.     jsr     WaitPort(a6)
  42. GetMessage:
  43.     move.l  _GadToolsBase,a6
  44.     move.l  ScrWin,a1
  45.     move.l  86(a1),a2
  46.     move.l  a2,a0
  47.     jsr     GT_GetIMsg(a6)
  48.     tst.l   d0
  49.     beq     WaitHere
  50.     move.l  d0,a1
  51.     move.l  20(a1),d4
  52.     move.l  #0,d5
  53.     move.w  24(a1),d5
  54.     move.l  28(a1),Gad
  55.     move.l  _GadToolsBase,a6
  56.     jsr     GT_ReplyIMsg(a6)
  57.     
  58.     
  59.     cmpi.l  #$200,d4                      ; CloseWindow
  60.     bne     NotCloseWindow
  61.     
  62.     jsr     CloseScrWinWindow
  63.     movea.l Scr,a0
  64.     movea.l _IntuitionBase,a6
  65.     jsr     CloseScreen(a6)
  66.     tst.l   d0
  67.     beq     CloseScreenFailed
  68.     move.l  #0,Scr
  69.     jmp     NoScreen
  70.  
  71. CloseScreenFailed:                        ; attempt to reopen window
  72.     movea.l Scr,a1
  73.     jsr     OpenScrWinWindow
  74.     tst.l   d0
  75.     bne     NoWindow                      ; mega failure, say goodbye.
  76.  
  77.     jmp     MessageDone
  78. NotCloseWindow:
  79.     
  80.     cmpi.l  #$40,d4                       ; GadgetUp
  81.     bne     NotStateGadgetUp
  82.     
  83.     move.l  #0,d0
  84.     movea.l  Gad,a0
  85.     move.w  38(a0),d0
  86.     cmp.w   #GD_State,d0
  87.     bne     NotStateGadgetUp
  88.     
  89.     move.l  d5,d0
  90.     tst.l   d0
  91.     bne     PrivScreen
  92.     movea.l Scr,a0
  93.     move.l  #0,d0
  94.     movea.l _IntuitionBase,a6
  95.     jsr     PubScreenStatus(a6)
  96.     jmp     MessageDone
  97. PrivScreen:
  98.     movea.l Scr,a0
  99.     move.l  #1,d0
  100.     movea.l _IntuitionBase,a6
  101.     jsr     PubScreenStatus(a6)
  102.     jmp     MessageDone
  103. NotStateGadgetUp:
  104.     
  105. MessageDone:
  106.     jmp     GetMessage
  107. Done:
  108.     jsr     CloseScrWinWindow
  109. NoWindow:
  110.     movea.l Scr,a0
  111.     move.l  a0,d0
  112.     tst.l   d0
  113.     beq     NoScreen
  114.     movea.l _IntuitionBase,a6
  115.     jsr     CloseScreen(a6)
  116. NoScreen:
  117.     jsr     CloseLibs
  118. NoLibs:
  119.     rts
  120.  
  121.     end
  122.